﻿package main.java.com.yc.navy.snacknet.util;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	//9021000122691937
	public static String app_id = "9021000122691937";
	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key = "MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQDBNbFyujTEMY/L6Ex/iYn8AQ8jygD3Arcvnus2KPJY2GmR4YChho/O0VDBnOXzHIX1QcleVIno/Gq3RMKl4fCWgKJ705mlzcc+85P+tXpE1+bGEqBY/g7VpRZjRYB8N2zedmF/d6ieirPLPbrH4+mKpgk7mSktgGkqfJxRwAo3B2ik7pqCbxF3h5iA3/S6U9HofqgU+/Bk9GK2Yb2dzzWRgDaNoacaJ/bebrkFGVn+sfhkH0hDiC4jnoR3ZYLmRSsK8ziPtT4oyfs+eNMNiNZj9mPgtBPNvs0kBYDAtlr+AldDkp1hMYlY2U8bQTvne0pYaZ2h18uWzfXLe/xV9RpvAgMBAAECggEAfpmvN4zZzIDpR2Rk0+EMwEr1X68aqMBnxlVsrGVyP1M3AbbwcWbZzlwLfYJQjtdu04ES8LOWVksnpgTxQn7lBckuLtM9R46p8w7qN6k0f+20sq870HRQxh9RpyTAhyROOwr44exHWfNq0k8Vl6s4uXgIbrvyZnVQ890JFOwwBVO6/pq5q66EcXIp4N9x3RPRpblXmMCbhCzO7Q3tYKC3RROLnqkxyAejMnbdSiQ5ZgvyMwTODgbxmvfDv4TxsIXEEScrMDItdNzt0CdjCCKekz2fLN++0uvBQJZnXufAnLVECLe1VhIm4lKfeQKTuOhY5V61txmXvTHuDDF5qvO5cQKBgQDgYEk4dtm2r3WNC3whAt5oHSV3oMWmvULyPwYvYGeK9eE4RcOrndmmskuJcdG9VwYZFvAXoem67KOYJLiHKpAqGDNnbTJy5UJv4IZTffTDAcFqZIFFtx9lgsoZ927d1pDqschuiKoOL/9Y3mZ6bx4nvJZDXXf9WovCe5xr14PLxwKBgQDccOSkxMdjSF4wCxu8zEWRm3Lc8jwRk9oHotEqUtp9SODI9fh77CIVkkL8QPAdBqPmgk/t8r3WxsdUOOsbEclshaL0r7XR0jH28JWYSRxj/o+lEypJusctnIxmMDIq+Tsoup1rKJTyuW+bHTSHqOCPqX9WlYZaWOMdZCgjpHAsGQKBgQDU0x/AmiMqAEW88l7cJQ92q+bFEM9JuA2PH66rM4MjMNRe/vV5jDFNx6KUjUyHjsru823qzJ6Zuin2fyY0t2+lLe1cNhx7FPCuk8Z13WxTqA+g7hIcYXU7YRJ4DNWxP/uXUeiux5yd9nL7BYEosstkn6Hb5gWRX9hfMcaOGA8gMwJ/PSMSRqBMrDxl4u0xxCrjIH78XErSXg2janq9h/9ymUydCx8syzGyQklOSqe38FTnIAcEI/ourGJ05ebjTZ6hPnfRugsBYi/pq5MN6i5csV7od9/Y2pnyo7PHPJAhWcnFnoYjIpUeujKzwVFYQEeWAEICDwFpQaVlV8FvYHM6qQKBgHkROGWUx3UUVd6y6evhpOAZdFockustZeH/N28N0xNB4pkqy0zQBtvh8TrSsdtkKdRcekQpK2jQ90XHtFcEvf2x+h4PPaEq9GS0KVEPBb4kEGL5w87uw/1DCWPTOuKtQsNhOSTV2psIy8yYg/UTewQ1Xxmot6deRJC/g95CjAyd";
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
	public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm8hB5PMSIscrZ3maWRNeSF4b7RkIJLNX9odeyFVOYzVo+hrnPJEga6nB67FRskmaCMXM5A98/PmMdez4FPsKHzgtxbIEWUOMJj2HLuD+hbwYxaiIZKDvTCY7BRK+xQlmXaRUQ3qYJ1xfiSbNA2uUKgeyJN+geQYoGg/9qxiAwL3W8NBfDmREB2B0QBlW+Q+Xg27W9LAnvCCtGMDL5keZeiUPx6xaSdKm4iQXFAQRnG12mDNs9p+2YOWmiJIiula2Ojli4OaregnzhfpOK+Iy70JvCOSbm+1c1qxZi0pyZgxTP1hThHVryGPXX1YCbMUbHf42w4TiT/JgBz6Ts16X7wIDAQAB";
	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/ssm/alipay/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/ssm/alipay/return_url";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关		//https://openapi.alipaydev.com/gateway.do
	//https://openapi.alipaydev.com/gateway.do
	//https://openapi-sandbox.dl.alipaydev.com/gateway.do
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "D:\\";

	//fbssfw6870@sandbox.com

	//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

	/** 
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
	 * @param sWord 要写入日志里的文本内容
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
